#!/usr/bin/env python

# First, ensure that WSGIWAPI and Xappy are on the path.
import sys
import os.path as osp
djapepath = osp.dirname(osp.abspath(__file__))
for ext in ['WSGIWAPI', 'xappy']:
    sys.path.insert(0, osp.join(djapepath, 'ext', ext))

from djape.server.application import Application
import wsgiwapi

server = wsgiwapi.make_server(Application(), ('0.0.0.0', 8080))

if __name__ == '__main__':
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
